package com.rd.student.jike.class1.sunhao.exam;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws IOException {
        System.out.println("请输入球员姓名：");
        Scanner scanner = new Scanner(System.in);
        String name=scanner.next();
        BufferedReader bufferedReader = new BufferedReader(new FileReader("player.txt"));
        String str="";
        boolean b = true;
        while ((str=bufferedReader.readLine())!=null){
            String[] strings =str.split(",");
            if (strings[0].equals(name)) {
                System.out.println(strings[0]+"所属的队伍是"+strings[1]);
                b=false;
            }
        }
        if (b){
            System.out.println("找不到该球员");
        }


    }



}
